package com.qiandao.xuexitong.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * 签到类型枚举
 */
@Getter
public enum AttendanceTypeEnum {
    NORMAL(0, "普通签到"),
    GESTURE(1, "手势签到"),
    LOCATION(2, "位置签到"),
    QR_CODE(3, "二维码签到"),
    CODE(4, "签到码签到");

    @EnumValue
    private final Integer code;
    private final String desc;

    AttendanceTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static AttendanceTypeEnum getByCode(Integer code) {
        for (AttendanceTypeEnum type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
} 